package com.bwie.order.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bwie.common.utils.PageUtils;
import com.bwie.common.utils.Query;

import com.bwie.order.dao.AuditDao;
import com.bwie.order.entity.AuditEntity;
import com.bwie.order.service.AuditService;


@Service("auditService")
public class AuditServiceImpl extends ServiceImpl<AuditDao, AuditEntity> implements AuditService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        QueryWrapper<AuditEntity> wrapper = new QueryWrapper<>();

        String auditName = (String) params.get("auditName");

        if (StringUtils.isNotEmpty(auditName)){
            wrapper.eq("audit_name",auditName);
        }

        IPage<AuditEntity> page = this.page(
                new Query<AuditEntity>().getPage(params),
                wrapper
        );

        return new PageUtils(page);
    }

}